<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>fullscreen  全屏样式</title>
  <style>
    .container {
      margin: 40px auto;
      max-width: 700px;
    }
    .element {
      padding: 20px;
      height: 300px;
      width: 100%;
      background-color: skyblue;
    }
    .element p {
      text-align: center;
      color: white;
      font-size: 3em;
    }
    .element:-ms-fullscreen p {
      visibility: visible;
    }
    .element:fullscreen {
      background-color: #e4708a;
      width: 100vw;
      height: 100vh;
    }
  </style>
</head>
<body>
    <div class="container">
        <p><em>Click the button below to enter the element into fullscreen mode. </em></p>
        <div class="element" id="element"><p>I change color in fullscreen mode!</p></div>
        <br />
        <button onclick="var el = document.getElementById('element'); el.webkitRequestFullscreen();">
          Go Full Screen!
        </button>
      </div>
</body>
</html>